Use String#b

Akinori MUSHA 9 years ago
parent
commit
11d2ee0a14
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/models/agents/ftpsite_agent.rb

+ 1 - 1
app/models/agents/ftpsite_agent.rb

@@ -196,7 +196,7 @@ module Agents
196 196
     end
197 197
 
198 198
     def uri_path_escape(string)
199
-      str = string.dup.force_encoding(Encoding::ASCII_8BIT)  # string.b in Ruby >=2.0
199
+      str = string.b
200 200
       str.gsub!(/([^A-Za-z0-9\-._~!$&()*+,=@]+)/) { |m|
201 201
         '%' + m.unpack('H2' * m.bytesize).join('%').upcase
202 202
       }